/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Control;

import Modelo.Carrito;
import Modelo.Producto;
import Modelo.Usuario;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.mvc.multiaction.MultiActionController;

/**
 *
 * @author jorge
 */
public class CarritComprasControl extends MultiActionController {
    
    private Usuario usuario;
    private Producto producto;
    private Carrito carrito;

    public void setUsuario(Usuario usuario) {
        this.usuario = usuario;
    }

    public void setProducto(Producto producto) {
        this.producto = producto;
    }
    
    public ModelAndView verLogin(HttpServletRequest request, HttpServletResponse response) throws Exception{
    
        ModelAndView mav = new ModelAndView ("Login");
        mav.addObject("usuario", usuario);
        return mav;
    }
    
     public ModelAndView verProductos(HttpServletRequest request, HttpServletResponse response) throws Exception{
    
        ModelAndView mav = new ModelAndView ("productos");
        mav.addObject("productos", producto.getProducto());
        return mav;
    }
    
     public ModelAndView conProd(HttpServletRequest request, HttpServletResponse response) throws Exception{
    
        ModelAndView mav = new ModelAndView ("consultar");
        mav.addObject("productos", producto.getProducto());
        return mav;
    }    
    
          public ModelAndView actStock(HttpServletRequest request, HttpServletResponse response) throws Exception{
    
        ModelAndView mav = new ModelAndView ("stock");
        mav.addObject("productos", producto.getProducto());
        return mav;
    }
          
    public ModelAndView agregaralcarro(HttpServletRequest request, HttpServletResponse response) throws Exception {
        ModelAndView mav = new ModelAndView("agregaralcarro");
        return mav;
    }

    public ModelAndView agregarproducto(HttpServletRequest request, HttpServletResponse response) throws Exception {

        ModelAndView mav = new ModelAndView("agregarproducto");
        return mav;
    }

    public ModelAndView finCompra(HttpServletRequest request, HttpServletResponse response) throws Exception {
        ModelAndView mav = new ModelAndView("compra");
        mav.addObject("productos", producto.getProducto());
        return mav;
    }
       
     
}
